package org.lagou.webservices;

import org.apache.catalina.LifecycleException;
import org.apache.catalina.startup.Tomcat;
import org.lagou.config.AppConfig;

import javax.servlet.ServletException;

/**
 * @author junbao
 */
public class SpringApplication {

    public static void run() {
        Tomcat tomcat = new Tomcat();
        tomcat.setPort(8881);
        try {
            tomcat.addWebapp("/", "F:\\lagou\\springboot\\SpringBootCustom");
            tomcat.start();
            tomcat.getServer().await();
        } catch (ServletException e) {
            e.printStackTrace();
        } catch (LifecycleException e) {
            e.printStackTrace();
        }
    }
}
